package com.Result;


import java.sql.Timestamp;
import java.util.Date;

public class BaseRespones<T> {
	private int code;
	private String msg;
	private Timestamp timestamp;
	private T data;

	
	public BaseRespones (StatusCode statusCode) {
	        this.code=statusCode.getCode();
	        this.msg=statusCode.getMsg();
	        this.timestamp=new Timestamp(new Date().getTime());
	    }

	public BaseRespones(Integer code, String msg) {
	        this.code = code;
	        this.msg = msg;
	        this.timestamp=new Timestamp(new Date().getTime());
	    }

	public BaseRespones(T data, StatusCode statusCode) {
	        this.data = data;
	        this.code=statusCode.getCode();
	        this.msg=statusCode.getMsg();
	        this.timestamp=new Timestamp(new Date().getTime());
	    }

	public BaseRespones(Integer code, String msg, T data) {
	        this.code = code;
	        this.msg = msg;
	        this.data = data;
	        this.timestamp=new Timestamp(new Date().getTime());
	    }

	
	public Integer getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public Timestamp getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}


	
	
}
